package edu.tgc.custom;

import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;

public class EasyuiPageForm {

    private Integer page = 1;
    private Integer rows = 20;

    public PageRequest buildPageRequest() {
        PageRequest pageRequest = new PageRequest(this.page - 1, this.rows);
        return pageRequest;
    }

    public PageRequest buildPageRequest(Sort sort) {
        PageRequest pageRequest = new PageRequest(this.page - 1, this.rows, sort);
        return pageRequest;
    }

    public Integer getPage() {
        return this.page;
    }

    public Integer getRows() {
        return this.rows;
    }

    public void setPage(Integer page) {
        this.page = page;
    }

    public void setRows(Integer rows) {
        this.rows = rows;
    }

}
